package com.sengled.cloud.biz.union.mgt.common.util;

import com.sengled.cloud.domain.CustomerSession;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created by csolo on 2017/11/17.
 */
public class CurrentUserUtil {
    public static Long getCurrentAccountId(HttpServletRequest request){
       /* long customerId = 0;
        HttpSession hs = request.getSession(false);
        if(hs != null) {
            CustomerSession customer = (CustomerSession) hs.getAttribute("user");
            if (null != customer) {
                customerId = customer.getCustomerId();
            }
        }
        return customerId;*/
        return 52L;
    }

    public static String getCurrentAccountUser(HttpServletRequest request){
        String username = "";

        HttpSession hs = request.getSession(false);
        if(hs != null){
            CustomerSession customer = (CustomerSession) hs.getAttribute("user");
            if(null != customer) {
                username = customer.getUser();
            }
        }
        return username;
        //return 23L;
    }
}
